package com.bawei.module_detail.model.api

import com.bawei.lib_common.entity.ResponseEntity
import com.bawei.lib_common.entity.SendCommentBody
import com.bawei.lib_common.entity.SendCommentEntity
import com.bawei.lib_common.entity.VideoCommentEntityItem
import com.bawei.module_detail.model.entity.BulletEntity
import com.bawei.module_detail.model.entity.BulletEntityItem
import com.bawei.module_detail.model.entity.LikeCollectBody
import com.bawei.module_detail.model.entity.LikeCollectEntity
import com.bawei.module_detail.model.entity.MovieEntityItem
import com.bawei.module_detail.model.entity.ReplyBody
import com.bawei.module_detail.model.entity.ReplyEntity
import com.bawei.module_detail.model.entity.SendBulletBody
import com.bawei.module_detail.model.entity.SendBulletEntity
import com.bawei.module_detail.model.entity.VideoCollectionEntityItem
import com.bawei.module_detail.model.entity.VideoLoveEntityItem
import com.bawei.module_detail.net.API
import kotlinx.coroutines.flow.Flow
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Query
import retrofit2.http.HTTP

interface VideoDetailApi {
    /**
     * 获取推荐视频
     */
    @GET(API.GET_SIMPLE_VIDEO_BY_CHANNEL_ID)
    suspend fun getVideoRecommend(@Query(API.PAGE)page:Int, @Query(API.PAGE_SIZE)pagesize:Int): ResponseEntity<List<MovieEntityItem>>
    /**
     * 获取视频评论接口
     */
    @GET(API.GET_COMMENT_BY_USER_ID)
    suspend fun getCommentByUserId(@Query(API.DATATYPE) datatype: Int, @Query(API.ITEMID) itemid: String): ResponseEntity<List<VideoCommentEntityItem>>
    /**
     * 发布视频评论
     */
    @POST(API.SEND_COMMENT)
    suspend fun sendComment(@Body body: SendCommentBody): ResponseEntity<SendCommentEntity>

    /**
     * 回复评论
     */
    @POST(API.REPLY_COMMENT)
    suspend fun reply(@Body replyBody: ReplyBody): ResponseEntity<ReplyEntity>
    /**
     * 删除视频评论
     */
    @DELETE(API.DELETE_COMMENT)
    suspend fun deleteComment(@Query(API.ID) commentid: Int): ResponseEntity<Boolean>

    /**
     * 删除回复评论
     */
    @DELETE(API.DELETE_REPLY)
    suspend fun replyDelete(@Query(API.ID)id:Int): ResponseEntity<Boolean>

    /**
     * 获取弹幕
     */
    @GET(API.GET_BULLET)
    suspend fun getBullet(@Query(API.DATATYPE)datatype:Int, @Query(API.ITEMID)itemid:String): ResponseEntity<List<BulletEntityItem>>
    /**
     * 发送弹幕
     */
    @POST(API.SEND_BULLET)
    suspend fun sendBullet(@Body body: SendBulletBody): ResponseEntity<SendBulletEntity>
    /**
     * 点赞视频
     */
    @PUT(API.AGREE_VIDEO)
    suspend fun agreeVideo(@Body body: LikeCollectBody): ResponseEntity<LikeCollectEntity>
    /**
     * 取消点赞视频
     */
    @HTTP(method = "DELETE", path = API.CANCEL_AGREE_VIDEO, hasBody = true)
    suspend fun cancelAgreeVideo(@Body body: LikeCollectBody): ResponseEntity<Boolean>
    /**
     * 检查是否点赞视频
     */
    @GET(API.CHECK_AGREE_VIDEO)
    suspend fun checkAgreeVideo(@Query(API.SOURCEFLAG) sourceflag: String, @Query(API.USERID) userId: Int): ResponseEntity<List<VideoLoveEntityItem>>
    /**
     * 收藏视频
     */
    @POST(API.COLLECT_VIDEO)
    suspend fun collectVideo(@Body body: LikeCollectBody): ResponseEntity<LikeCollectEntity>
    /**
     * 取消收藏视频
     */
    @HTTP(method = "DELETE", path = API.CANCEL_COLLECT_VIDEO, hasBody = true)
    suspend fun cancelCollectVideo(@Body body: LikeCollectBody): ResponseEntity<Boolean>
    /**
     * 检查是否收藏视频
     */
    @GET(API.CHECK_COLLECT_VIDEO)
    suspend fun checkCollectVideo(@Query(API.SOURCEFLAG) sourceflag: String, @Query(API.USERID) userId: Int): ResponseEntity<List<VideoCollectionEntityItem>>
}